﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet" />
    <link href="/CSS/V3/BaseClassV3.css" rel="stylesheet" />
    <link href="/CSS/V3/animate.css" rel="stylesheet" />
    <link href="/CSS/V3/style.css" rel="stylesheet" />
    <link href="/CSS/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="/JqueryPlug/dtGrid/jquery.dtGrid.css" rel="stylesheet">
    <script src="/Scripts/jquery-1.11.2.min.js"></script>
    <script src="/JqueryPlug/laypage/laypage.js"></script>
    <script src="/Scripts/bootstrap.js"></script>
    <script src="/Scripts/avalon.js"></script>
    <script src="/Scripts/jquery-migrate-1.1.0.min.js"></script>
    <script src="/Scripts/SZHLCommon.js?jsver=5"></script> 
    <script>
 
        function ViewWF(ID, PIID, ProName) {
            parent.ComFunJS.winviewform("/ViewV3/APPBaseView/APP_ADD_WF.html?FormCode=" + ProName + "&ID=" + ID + "&PIID=" + PIID, "审核表单", "1000", "");
        }
        var model = avalon.define({
            $id: "APP_WF_Status",
            curSPType: 0,
            CommonData: [],
            GetSPDataList: function (type) {
                model.curSPType = type;
                model.CommonData.clear();
                var actionName = "";
                if (model.curSPType) {
                    actionName = "GETYSPLIST_PAGE";
                } else {
                    actionName = "GETDSHDATALIST_PAGE";
                }
                $.getJSON('/API/FTAPI.ashx?Action=' + actionName,{P2: 1}, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        model.CommonData = resultData.Result;
                        laypage({
                            cont: 'pageDiv', //容器。值支持id名、原生dom对象，jquery对象。
                            pages: parseInt(resultData.Result1)*1.0/8, //通过后台拿到的总页数
                            curr: 1, //初始化当前页
                            jump: function (e) { //触发分页后的回调
                                if (model.selXMType != model.XMType || model.selXMContent != model.XMContent) {
                                    e.curr = 1;
                                }
                                $.getJSON('/API/FTAPI.ashx?Action=' + actionName, {  P2: e.curr}, function (resultData) {
                                    model.CommonData.clear();
                                    model.CommonData = resultData.Result;
                                    model.selXMType = model.XMType;
                                    model.selXMContent = model.XMContent;
                                    model.selpeo = model.peo;
                                })
                            }
                        });
                    }
                })

            }, GetStatusName: function (record)
            {
                if (record.StateName == "正在审批") {
                    content = "<a href='javascript:void(0)' onclick='ViewWF(" + record.ID + "," + record.intProcessStanceid + ",\"" + record.ProName + "\")'><i class='iconfont icon-shezhichilun fa-spin'></i>" + record.StateName + "</a>";
                } else if (record.StateName == "已退回") {
                    content = "<a href='javascript:void(0)' style='color:red' onclick='ViewWF(" + record.ID + "," + record.intProcessStanceid + ",\"" + record.ProName + "\")'>" + record.StateName + "</a>";
                } else {
                    content = "<a href='javascript:void(0)' style='color:green' onclick='ViewWF(" + record.ID + "," + record.intProcessStanceid + ",\"" + record.ProName + "\")'>" + record.StateName + "</a>";
                }
                return content;
            }
        });
        avalon.ready(function () {
            ComFunJS.initsetajax();
            model.GetSPDataList(0);
        })
    </script>
</head>
<body class="gray-bg" ms-controller="APP_WF_Status">
    <div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
            <div class="col-sm-2" style="border-right: 1px solid #e7eaec;">
                <div class="float-e-margins">
                    <div class="ibox-content" style="border:none">
                        <div class="file-manager">
                            <h4>审核列表：</h4>
                            <button class="btn  btn-block" ms-class-1="btn-primary:model.curSPType==0" ms-class-2="btn-white:model.curSPType!=0" ms-click="GetSPDataList(0)" type="button">待审核</button>
                            <button class="btn  btn-block" ms-class-1="btn-primary:model.curSPType==1" ms-class-2="btn-white:model.curSPType!=1" type="button" ms-click="GetSPDataList(1)">已审核</button>
                            <div class="hr-line-dashed"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-10" >
                <div class="box" style="margin-bottom:15px;"> 
                    <h2>
                        我的流程
                    </h2>
                    <div class="mail-tools tooltip-demo m-t-md">
                        <div class="btn-group pull-right">
                            <div id="pageDiv" class="text-right"></div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div> 
                <div class="full-height-scroll" >
                    <div class="table-responsive">
                        <table class="table  table-hover">
                            <thead>
                                <tr>
                                    
                                    <th>申请人</th>
                                    <th>流程名称</th>
                                    <th>创建时间</th>
                                    <th>创建人</th>
                                    <th>审批状态</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ms-repeat-el="CommonData">
                                    <td>
                                        {{el.ShenQingRen}}
                                    </td>
                                    <td>{{el.Name}}</td>
                                    <td>{{el.CRDate}}</td>
                                    <td> {{ComFunJS.convertuser(el.CRUser)}}</td>
                                    <td class="client-status">
                                      {{GetStatusName(el)|html}}
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
